home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC] / NeXTSTEP 3.3 Dev Intel.iso / usr / sybase / doc / dbtabcount.man < prev    next >
Text File  |  1993-04-22  |  3KB  |  89 lines

  1.  
  2.   1                       Version 4.0 -- 5/1/89               dbtabcount
  3.   ______________________________________________________________________
  4.  
  5.   NAME:  dbtabcount
  6.  
  7.   FUNCTION:
  8.        Return the number of tables involved in the current SELECT query.
  9.  
  10.   SYNTAX:
  11.        int dbtabcount(dbproc)
  12.  
  13.        DBPROCESS *dbproc;
  14.  
  15.   COMMENTS:
  16.  
  17.        o dbtabcount() is one of the DB-Library browse mode routines.  It
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.   dbtabcount              Version 4.0 -- 5/1/89                        2
  25.   ______________________________________________________________________
  26.          is usable only with results from a browse-mode SELECT (i.e.,  a
  27.          SELECT containing the key words FOR BROWSE).  See the Introduc-
  28.          tion for a detailed discussion of browse mode.
  29.  
  30.        o A SELECT query can generate a set of result rows whose  columns
  31.          are  derived  from several database tables.  To perform browse-
  32.          mode updates of columns in a query's select-list, the  applica-
  33.          tion  must  know  how  many  tables were involved in the query,
  34.          because  each  table  requires  a  separate  UPDATE  statement.
  35.          dbtabcount()  can  provide this information for ad hoc queries.
  36.          If the query has been hardcoded into the program, this  routine
  37.          is obviously unnecessary.
  38.        o The count returned by  this  routine  includes  any  SQL Server
  39.          "work  tables"  used  in  processing  the query. The SQL Server
  40.          sometimes creates temporary, internal work tables to process  a
  41.          query.   It  deletes  these work tables by the time it finishes
  42.          processing the statement.  Work tables are  not  updatable  and
  43.  
  44.  
  45.  
  46.   3                       Version 4.0 -- 5/1/89               dbtabcount
  47.   ______________________________________________________________________
  48.          are not available to the application.  Therefore, before  using
  49.          a table number, the application must make sure that it does not
  50.          belong to a work table.  dbtabname() can be used  to  determine
  51.          whether a particular table number refers to a work table.
  52.  
  53.        o The  application  can  call   dbtabcount()   any   time   after
  54.          dbresults().
  55.        o Example 7 in the DB-Library  Reference  Supplement  contains  a
  56.          call to dbtabcount().
  57.  
  58.   PARAMETERS:
  59.        dbproc -  A pointer to the DBPROCESS structure that provides  the
  60.            connection for a particular front-end/SQL Server process.  It
  61.            contains all the information that DB-Library uses  to  manage
  62.            communications and data between the front end and SQL Server.
  63.  
  64.   RETURNS:
  65.  
  66.  
  67.  
  68.   dbtabcount              Version 4.0 -- 5/1/89                        4
  69.   ______________________________________________________________________
  70.        The number of tables, including SQL Server work tables,  involved
  71.        in the current set of row results.
  72.  
  73.        dbtabcount() will return -1 in case of error.
  74.  
  75.   SEE ALSO:
  76.        dbcolbrowse, dbcolsource, dbqual, dbtabbrowse, dbtabname,  dbtab-
  77.        source, dbtsnewlen, dbtsnewval, dbtsput
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.